#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	char ch[105] = { 0 };
	scanf("%s", ch);
	char ch1[] = "VK";
	int count = 0;
	int cur = 0;
	int pls = 0;
	while (cur < n - 1)
	{
		if (ch[cur] == 'V' && ch[cur + 1] == 'K')
		{
			count++;
			cur += 2;
			continue;
		}
		if (ch[cur] == 'V' && ch[cur + 1] == 'V' && ch[cur + 2] != 'K')
			pls = 1;
		if (ch[cur] == 'K' && ch[cur + 1] == 'K')
			pls = 1;
		cur++;
	}
	printf("%d\n", count + pls);
	return 0;
}